import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/Home'
import Download from '@/pages/download/Download'
import User from '@/pages/user/User'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/download',
      name: 'Download',
      component: Download
    },
    {
      path: '/user',
      name: 'User',
      component: User
    }
  ],
  /**
   * [scrollBehavior 切换页面时滚动条自动滚到顶部]
   * @param  {[type]} to            [description]
   * @param  {[type]} from          [description]
   * @param  {[type]} savedPosition [description]
   * @return {[type]}               [description]
   */
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
